#include "convex_hull.h"
#include <algorithm>

int main()
{
	int n;
	std::cin >> n;
	std::vector<Point> points, ans;
	for (int i = 0; i < n; i++) 
	{
		double x, y;
		std::cin >> x >> y;
		points.push_back(Point(x, y));
	}

	quick_hull(points, ans);

	std::cout << ans.size() << "\n";

	std::cout << std::fixed;
	std::cout.precision(40);
	
	for (int i = ans.size() - 1; i >= 0; i--)
	{
		std::cout << ans[i] << "\n";
	}
}